package com.html2rss.ui.wizard;

import org.apache.struts.actions.BaseAction;
import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethodBase;
import org.apache.commons.httpclient.URI;
import org.apache.commons.httpclient.util.EncodingUtil;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.w3c.dom.*;
import org.dom4j.DocumentException;
import com.html2rss.models.UserPage;
import com.html2rss.models.WizardHistory;
import com.html2rss.core.exceptions.HtmlToRssException;
import com.html2rss.core.parser.HTMLFeedExtracter;
import com.html2rss.core.HttpURL;
import com.html2rss.plugins.InitializationPlugIn;
import com.dappit.Dapper.parser.ParserInitializationException;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.regex.Pattern;
import java.util.regex.Matcher;

/**
 * User: VSlaykovskiy
 * Date: 12.04.2007
 * Time: 17:30:48
 */
public class BaseWizardAction extends BaseAction {
    public static final String URL_PARAM_NAME = "__url__";
    public static final String HTML_TO_RSS_ID = "__htmltorss_id__";
    public static final String FEED_ID = "feed_id";
    public static final String FEED_TAG_IDS = "feed_tag_ids";
             

    public void setWizardNavigationHistory(HttpServletRequest httpServletRequest, WizardHistory wizardHistory) {
        httpServletRequest.getSession().setAttribute("wizardHistory", wizardHistory);
    }

    public  WizardHistory getWizardNavigationHistory(javax.servlet.http.HttpServletRequest httpServletRequest) {
        WizardHistory result = (WizardHistory) httpServletRequest.getSession().getAttribute("wizardHistory");
        if (result == null) {
            setWizardNavigationHistory(httpServletRequest, new WizardHistory());
            return getWizardNavigationHistory(httpServletRequest);
        }
        return result;
    }

}
